Purpose
The parse task is used to parse a JSON string (written in JSON format) and return a JavaScript (JS) object. If a malformed JSON string is passed, an exception is thrown. This task is very useful when dealing with JSON-formatted content.
Potential Use Case
Some systems will return an XML payload which has stringified json. The parse task will reform the string into a working JSON object so that the individual components of data within the JS object can be accessed.
Properties
Input and output properties are shown below.
| Input | Type | Description | 
|---|---|---|
| text | String | Required. The JSON string to parse. If the string is malformed (not a valid JSON format), an exception is thrown. | 
| Output | Type | Description | 
|---|---|---|
| textObject | Object | The JSON object that returns when the input textis parsed. | 
Examples
In the IAP examples shown below:
- The - textstring to parse is statically set to- {"firstName": "John", "lastName": "Smith", "age": 22, "state": "California"}. 
- The outgoing - textObjectvariable would be:- { "firstName": "John", "lastName": "Smith", "age": 22, "state": "California" }